package middol.notice
/**
* @Description:    通知工厂类
* @Author:         zhangjiayu@middol.com
* @CreateDate:     2020/10/22 13:42
* @Version:        1.0
*/
class NoticeHandlerFactory {
    static Map<String, INoticeHandler> noticeHandlerMap

    static {
        this.noticeHandlerMap = NoticeHandlerContainer.getNoticeHandlerMap()
    }

    /**
     * 根据消息类型获取对应的通知类
     * @param messageType
     * @return
     */
    static INoticeHandler getNoticeHandler(String messageType){
        this.noticeHandlerMap.find {k,v ->
            v.name?.toUpperCase() == messageType?.toUpperCase()
        }?.getValue()
    }
}
